<?php 
$CI =& get_instance();
$CI->load->library("admin/admin_header_lib");
$CI->admin_header_lib->display_header_element(array("script"=>array("jquery-1.4.2","jquery.validate","jquery.metadata")));
$CI->admin_header_lib->display_header();

$CI->load->library('admin/admin_sidebar_lib');
$CI->admin_sidebar_lib->display_sidebar();

?>

<script type="text/javascript">
function confirmation(){
   
    var total='';
  
    for(var i=0; i < document.paper_delete.papers.length; i++){
       
        if(document.paper_delete.papers[i].checked)
        {
            total +=document.paper_delete.papers[i].value + "\n";
        
        }
    }
        if(total==""){
        alert("Please select paper size");
        return false;
        }
        else{
            if(confirm('Are you sure to delete ?'))
               document.paper_delete.submit();
            else
                return false;
        
        }
  
 
    
}
</script>

<div class="admin_right">

<!--End  List-->
<?php
$attributes = array('name' => 'paper_delete', 'id' => 'paper_delete','class' =>'paper_delete');
 echo form_open('admin/paper_list/delete',$attributes);?>
 <table width="100%" class="grid_tbl">
       <tr>
       <th><h2 class="head02">paper lists</h2></th>
       <th align="center" colspan="3">list by: 
       <a class="red13" href="<?php echo site_url('admin/paper_list/index/paper' )?>">paper</a>
       - <a class="red13" href="<?php echo site_url('admin/paper_list/index/colour' )?>">colour</a>
       - <a class="red13" href="<?php echo site_url('admin/paper_list/index/size' )?>">size</a></th>
       <th align="right"><a class="red13" href="<?php echo site_url('admin/paper_list/form' )?>">< add new paper </a></th>
       </tr>
        <?php if(!empty($paper_list)): ?>
        <?php foreach($paper_list as $key=>$value): ?>
        <tr>
      	<td><?php echo $value['paper_title'] ?></td>
        <td><?php echo $value['paper_colour'] ?></td>
        <td><?php echo $value['paper_size'].' gsm' ;?></td>
      	<td align="center">  
        	<input type="checkbox" name="papers[]"  id="papers" class="papers"  value="<?php echo $value['paper_id']?>" />
         </td>
       <td align="right">  
        <a class="red13" href="<?php echo site_url('admin/paper_list/form/'.$value['paper_id'].'/'.$page); ?>">Edit</a></td>
		</tr>
        
        <?php endforeach; ?>
        <?php endif; ?>
       
     <tr>
     <td><a class="red13" href="<?php echo site_url('admin/paper_list/form' )?>">< add new paper</a></td>
     <td colspan="4" align="right"><input type="button" name="delete" onclick="return confirmation()" value="Delete Selected"/>
     
     </td></tr>
 </table>

 <div class="pagination">
	<?php echo $pagination; ?>
</div>

<?php /*  end of all  content  */ ?>
</div><!-- page noright -->



<?php  $this->load->view(TEMPLATE_NAME.'/admin/footer');?>